
	function valbutton_acct(thisform,objname) {
		var objradio = thisform.radioTK;
		var radioLength = objradio.length;
		var id, i, curr, dc;
		if(!radioLength){
			id = objradio.value;		
		}else{
			for(i = 0; i < radioLength; i++){
				if(thisform.radioTK[i].checked){
					curr = document.getElementById('LOAITIEN'+i).value
					dc = document.getElementById('DC_LIST'+i).value
					id = thisform.radioTK[i].value +'#'+ dc +'#'+ curr;
					break;
				}
			}
		}
		var name = id;	
		var lblname = objname;
		//alert(objname);
		//alert(name);
		var obj = window.opener.document.getElementById(lblname);
		
		if(obj){
			obj.value = name;
		}
		
		window.close();
	}
	
	function valbutton_branh(thisform,objname) {
		var objradio = thisform.radioTK;
		var radioLength = objradio.length;
		var id, i;
		if(!radioLength){
			id = objradio.value;		
		}else{
			for(i = 0; i < radioLength; i++){
				if(thisform.radioTK[i].checked){
					id = thisform.radioTK[i].value;
					break;
				}
			}
		}
		var name = id.split('-');	
		//alert(objname);
		var lblname = objname.split('-');
		var obj1 = window.opener.document.getElementById(lblname[0]);
		var obj2 = window.opener.document.getElementById(lblname[1]);
		if(obj1){
			obj1.value = name[0];
			var phongtructhuoc = window.opener.document.getElementById("phongtructhuoc");
			if(phongtructhuoc){
				phongtructhuoc.click();	
			}
		}
		if(obj2){
			obj2.value = name[1];
		}
		
		window.close();
	}
	
	function checkKey(evt){		
		evt = (evt) ? evt : ((window.event) ? event : null);
		if (evt) {
		   var elem = (evt.target) ? evt.target : 
			  ((evt.srcElement) ? evt.srcElement : null);
		   if (elem) {
			   var charCode = (evt.charCode) ? evt.charCode : 
				   ((evt.which) ? evt.which : evt.keyCode);
				
			   if (charCode == 13 ) {	
			   		//alert(charCode);		   		
					document.getElementById('replacement_find').click();	
					return false;					   
			   }else{
			   		return true;
			   }
		   }
		}
	}
	
	function number_branh(evt) {
		evt = (evt) ? evt : ((window.event) ? event : null);
		if (evt) {
		   var elem = (evt.target) ? evt.target : 
			  ((evt.srcElement) ? evt.srcElement : null);	   
		   if (elem) {
			   //var charCode = (evt.charCode) ? evt.charCode : 
				//   ((evt.which) ? evt.which : evt.keyCode);
			   var charCode = evt.which;
			   //alert(charCode);	   
			   if ((charCode < 32 ) || 
					charCode == 37 || charCode == 39 || charCode == 46 ||
				   (charCode > 44 && charCode < 47) || 
				   (charCode > 47 && charCode < 58)) {
				   return true;
			   } else {
				   return false;
			   }
		   }
		}		
	}
	
	
	function valbutton(thisform,objname) {
		var objradio = thisform.radioTK;
		var radioLength = objradio.length;
		var id, i;
		if(!radioLength){
			id = objradio.value;		
		}else{
			for(i = 0; i < radioLength; i++){
				if(thisform.radioTK[i].checked){
					id = thisform.radioTK[i].value;
					break;
				}
			}
		}
		var name = id.split('-');	
		//alert(objname);
		var lblname = objname.split('-');
		var obj1 = window.opener.document.getElementById(lblname[0]);
		var obj2 = window.opener.document.getElementById(lblname[1]);
		if(obj1){
			obj1.value = name[0];
			var phongtructhuoc = window.opener.document.getElementById("phongtructhuoc");
			if(phongtructhuoc){
				phongtructhuoc.click();	
			}
		}
		if(obj2){
			obj2.value = name[1];
		}
		
		window.close();
	}